import warnings
warnings.filterwarnings('ignore')
from ultralytics import RTDETR
 
if __name__ == '__main__':
    model = RTDETR('ultralytics/cfg/models/v8/yolov8-rtdetr.yaml')
    model.train(data='ultralytics/cfg/datasets/mydata.yaml',
                imgsz=640,
                epochs=150,
                batch=32,
                workers=0,
                device=0,
                optimizer='SGD', # 这里可以使用两个优化器SGD 和AdamW其它的可能会导致模型无法收敛
                )